package com.dearbinge.data.dao.admin;

import com.dearbinge.data.pojo.admin.AdminSecurityAuthorityDO;
import com.dearbinge.data.pojo.admin.vo.AdminSecurityAuthorityResponseVO;
import org.mapstruct.Mapper;

import java.util.List;

/**
 * 后台权限dao
 * @author wes
 * @date 2019/4/11
 */
@Mapper
public interface AdminSecurityAuthorityMapper {

    /**
     * 逻辑删除
     * @param authorityId id
     * @return 影响行数
     */
    int delete(Integer authorityId);

    /**
     * 插入
     * @param adminSecurityAuthorityDO DO
     * @return 影响行数
     */
    int insert(AdminSecurityAuthorityDO adminSecurityAuthorityDO);

    /**
     * 根据id查询
     * @param authorityId id
     * @return DO
     */
    AdminSecurityAuthorityDO getById(Integer authorityId);

    /**
     * 更新
     * @param adminSecurityAuthorityDO DO
     * @return 影响行数
     */
    int update(AdminSecurityAuthorityDO adminSecurityAuthorityDO);

    /**
     * 查询全部 包括下级
     * @param roleId 角色id
     * @return 树状结构
     */
    List<AdminSecurityAuthorityResponseVO> listAll(Integer roleId);

}